package hari2.latihan;

import java.util.ArrayList;
import java.util.List;

public class Person2 {
	private long id;
	private String name;
	private String phone;
	
	public Person2() {}
	public Person2(String n, String p) {
		name = n;
		phone = p;
	}
	
	public String toString() {
		return name + "\t" + phone;
	}
	
	public void setName(String n) {
		this.name = name;
	}
	public void setPhone(String p) {
		this.phone = phone;
	}
	
	public static void main(String[] args) {
		List daftar = new ArrayList();
		
		Person pData = new Person();
		pData.setName("Mpu Tantular");
		pData.setPhone("888-888");
		daftar.add(pData);
		
		pData.setName("Ken Arok");
		pData.setPhone("123-456");
		daftar.add(pData);
		
		pData.setName("Gajah Mada");
		pData.setPhone("0808-0808");
		daftar.add(pData);
		
		for (Object o : daftar) {
			System.out.println(o);
		}	
	}
}
